Following is an abbreviated requirement thatreflects an actual implementation that was done for a large SiliconValley company. We follow the mini-methodology as closely as possibleto implement this requirement in SSAS, pointing out which facilities ofSSAS should be used for which purpose along the way.
A large computermanufacturer named CompSales International needs to do basic analyticalprocessing of its product data in a new BI environment. The mainbusiness issues at hand are related to minimizing channel inventory andbetter understanding market demand for the company’s most popularproducts. The detailed data processing requirements are as follows:
-
Youwant to view sales unit actuals and sales returns for system andnonsystem products for the past two years via the product hierarchy(All Products, Product Types, Product Lines, Product Families, SKUs),geography hierarchy (All Geos, Major Geos, Countries, Channels,Customers), and different time levels (All Time, Years, Quarters,Months).
-
-
-
-
You need to implement some general design decisions using SSAS, including the following:
-
Hierarchies (dimensions)—
This includes product, geography, and time.
-
Facts (measures)—
This includes sales units, sales returns, and net sales (units minus returns) calculated.
-
OLAP storage—
This will be MOLAP or HOLAP (if you want to use the star-schema data mart that already contains most of what you are after).
-
Physical tables that exist—
This includes Geo_Dimension, Prod_Dimension, Time_Dimension, and CompSalesFactoid
(the fact table that will become your measures in the OLAP cube). Thisdata is updated weekly. Each of these tables uses an artificial keyinto the main facts table for performance reasons (GeoID, ProductID, TimeID
).In addition, several member/value description tables are associatedwith each dimension table. Basically, there is one table for each levelin a dimension. These description tables can be leveraged to make theresult rows from OLAP queries much more user friendly .
Figure 1
illustrates the desired hierarchies and facts for CompSales International’s requirements.
A star-schema data mart/warehouse named CompSales2008
is used as the basis of creating the OLAP cube example in this article. You can download this data mart, CompsSales2008.zip
, from the Sams Publishing website for this book title at
www.samspublishing.com
,and it is also on this book’s CD. You can easily unzip and attach thisdatabase to any SQL Server 2008 database instance. This is not an SSASdatabase; it is a SQL Server database of a star-schema datawarehouse/mart. We use this SQL Server database as the source for theexercises in this article. You will build the SSAS OLAP cube yourself(by following the steps outlined here).
You’ll spend mostof the construction phase using SQL Server Business IntelligenceDevelopment Studio (BIDS; also known as Visual Studio) and MicrosoftSQL Server Management Studio (SSMS). All wizards and editors areinvoked from either BIDS or SSMS. As mentioned earlier, Microsoft hasmoved to a project orientation. For this reason, you need to start outin the BIDS (which actually invokes Visual Studio with the BIplug-ins). You must have already installed SSAS. In general, here’swhat you’ll be doing in this example:
1.
|
Create a BI project.
|
2.
|
Identify data sources and data source views that you want to use for a new cube.
|
3.
|
Define the basic dimensions for the cube (Time, Geography, Product).
|
4.
|
Define the hierarchies.
|
5.
|
Process the dimensions.
|
6.
|
Create a cube structure.
|
7.
|
Define the measure groups/measures.
|
8.
|
Process the cube.
|
9.
|
Deploy the solution.
|
10.
|
Use the cube.
|
Using SQL Server BIDS
The SQL Server BIDS (a.k.a.
Visual Studio with the BI plug-ins) is launched from the SQL Server
2008 Program group on the Start menu or from the Visual Studio 2008
Program group on the Start menu. We will assume you have installed
Visual Studio and SQL Server Analysis Services. When this is open, you
choose File, New Project, Business Intelligence Projects. Figure 2
shows the New Project dialog from which you should highlight the
Analysis Services Project template option and specify a project name,
project location, and solution name for this new BI project. In this
case, the solution name is CompSalesUnleashed.
Note
You can also start a new
project by leveraging any other existing SSAS database project. You can
easily clone an existing project and tweak it a bit to fit your new
needs. To do this, you use the Import Analysis Services Database option.
After you create a new project, a set of objects is presented to you in the upper-right pane, which is the Solution Explorer. Figure 3
shows the Solution Explorer for the new project. All OLAP project
objects reside here, including data sources, dimensions, cubes, mining
structures, and roles.